package com.smh.a01immutableDemo1;

import java.util.Map;
import java.util.Set;

public class ImmutableDemo3 {
    public static void main(String[] args) {


        //肩不能重复
        //参数有上限,最多10对
        Map<String,String> map = Map.of("asd","zxc","zxc","qweqw");

        Set<String> keySet = map.keySet();
        for (String s : keySet) {
            System.out.println(s+"="+map.get(s));
        }

        Set<Map.Entry<String, String>> entries = map.entrySet();
        for (Map.Entry<String, String> entry : entries) {
            System.out.println(entry.getKey()+"="+entry.getValue());
        }




    }

    //报错
    //一个形参只能有一个可变参数.但是我们可以存一个键值对对象
//    public static<K,V> void of(K ...key,V ...value){
//
//    }
}
